package com.company.test1;

public class GameTest {
    public static void main(String[] args) {
        // role1
        Role r1 = new Role("黄蓉", 100);
        // role2
        Role r2 = new Role("李莫愁", 100);

        // 格斗
        while(true) {
            r1.attack(r2);
            if (r2.getBlood() == 0) {
                System.out.println(r1.getName() + "K.O了" + r2.getName());
                break;
            }

            r2.attack(r1);
            if (r1.getBlood() == 0) {
                System.out.println(r2.getName() + "K.O了" + r1.getName());
                break;
            }
        }
    }

}
